package org.goochasca

final class BarChart (
  width: Int, height: Int,
  orientation: Orientation,
  isStacked: Boolean,
  range: Range,
  dataSet: Data*
) extends Chart(width, height, range, dataSet) 
with Title with Colors with Axis with Legend with GridLines {

  def this(width: Int, height: Int, range: Range, dataSet: Data*) = 
    this(width, height, VERTICAL, false, range, dataSet:_*)
  
  val chartType = orientation match {
    case HORIZONTAL if isStacked => "bhs"
    case HORIZONTAL => "bhg"
    case VERTICAL if isStacked => "bvs"
    case VERTICAL => "bvg"
  }
    
  override protected def appendParms(sb: StringBuilder) {
    super.appendParms(sb)
    sb append "&chbh=a"
  }
}
